/*
 * @Date: 2022-04-13 16:01:40
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-04-15 09:33:15
 * @FilePath: \Vue3-ts-cms\src\service\request\type.ts
 * @description: 文件描述
 */
import type { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface YXRequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestCatchInterceptor?: (error: any) => any
  responseInterceptor?: (res: T) => T
  responseCatchInterceptor?: (error: any) => any
}

export interface YXRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: YXRequestInterceptors<T>
  headers?: any
  showLoading?: boolean
}
